﻿using dz.u9.jky.schema.Attrib;
using dz.u9.jky.schema.Common;
using System;
using System.Collections.Generic;

namespace dz.u9.jky.schema.PM
{
    public class Receivement
    {
        /// <summary>
        /// 业务日期
        /// </summary>
        public DateTime BusinessDate { get; set; } = DateTime.Now;

        /// <summary>
        /// 弹性域
        /// </summary>
        [DzComplexObject("UFIDA.U9.Base.FlexField.DescFlexField.DescFlexSegments,UFIDA.U9.Base.BaseBE")]
        public DescFlexField DescFlexField { get; set; }

        /// <summary>
        /// 来源类别
        /// </summary>
        /// 
        [DzEnum("UFIDA.U9.PM.Enums.RcvSrcDocTypeEnum,UFIDA.U9.PM.PMBE")]
        public int SrcDocType { get; set; } = 0;

        /// <summary>
        /// 核算组织 
        /// </summary>
        /// 
        [DzSimpleObject("UFIDA.U9.PM.DTOs.BESimp4UIDTO,UFIDA.U9.PM.PMBE")]
        public string AccountOrg { get; set; }

        [DzSimpleObject("UFIDA.U9.PM.DTOs.BESimp4UIDTO,UFIDA.U9.PM.PMBE")]
        /// <summary>
        /// 供应商
        /// </summary>
        public string Supplier { get; set; }

        [DzSimpleObject("UFIDA.U9.PM.DTOs.BESimp4UIDTO,UFIDA.U9.PM.PMBE")]
        /// <summary>
        /// 付款供应商
        /// </summary>
        public string Payer { get; set; }

        [DzComplexObject("UFIDA.U9.CBO.SCM.Supplier.SupplierSiteMISCInfo,UFIDA.U9.CBO.PubBE")]

        /// <summary>
        /// 付款位置
        /// </summary>
        public string PayerSite { get; set; }

        [DzSimpleObject("UFIDA.U9.PM.DTOs.BESimp4UIDTO,UFIDA.U9.PM.PMBE")]
        /// <summary>
        /// 立账条件
        /// </summary>
        public string ConfirmTerm { get; set; }

        [DzSimpleObject("UFIDA.U9.PM.DTOs.BESimp4UIDTO,UFIDA.U9.PM.PMBE")]
        /// <summary>
        /// 付款条件
        /// </summary>
        public string PaymentTerm { get; set; }

        [DzSimpleObject("UFIDA.U9.PM.DTOs.BESimp4UIDTO,UFIDA.U9.PM.PMBE")]
        /// <summary>
        /// 核币
        /// </summary>
        public string AC { get; set; }

        [DzSimpleObject("UFIDA.U9.PM.DTOs.BESimp4UIDTO,UFIDA.U9.PM.PMBE")]
        /// <summary>
        /// 价目表
        /// </summary>
        public string PriceList { get; set; }

        /// <summary>
        /// 价格含税 
        /// </summary>
        public bool IsPriceIncludeTax { get; set; } = true;

        [DzSimpleObject("UFIDA.U9.PM.DTOs.BESimp4UIDTO,UFIDA.U9.PM.PMBE")]
        /// <summary>
        /// 税组合
        /// </summary>
        public string TaxSchedule { get; set; }

        /// <summary>
        /// 期初暂估
        /// </summary>
        public bool IsInitEvaluation { get; set; } = false;

        [DzSimpleObject("UFIDA.U9.PM.DTOs.BESimp4UIDTO,UFIDA.U9.PM.PMBE")]
        /// <summary>
        /// 收货原则
        /// </summary>
        public string RcvBy { get; set; }
        /// <summary>
        /// 整单费用
        /// </summary>
        public decimal HeadFeeAC { get; set; } = 0;

        [DzSimpleObject("UFIDA.U9.PM.DTOs.BESimp4UIDTO,UFIDA.U9.PM.PMBE")]
        /// <summary>
        /// 单据类型
        /// </summary>
        public string RcvDocType { get; set; }

        [DzEnum("UFIDA.U9.Base.Doc.BusinessTypeEnum,UFIDA.U9.Base.BaseBE")]
        /// <summary>
        /// 
        /// </summary>
        public int BizType { get; set; } = 316;
        [DzSimpleObject("UFIDA.U9.CBO.SCM.Customer.CustomerMISCInfo,UFIDA.U9.CBO.PubBE")]
        /// <summary>
        /// 退货客户 
        /// </summary>
        public string RtnCustomer { get; set; }

        [DzSimpleObject("UFIDA.U9.PM.DTOs.BESimp4UIDTO,UFIDA.U9.PM.PMBE")]
        /// <summary>
        /// 本币
        /// </summary>
        public string FC { get; set; }

        [DzList("UFIDA.U9.ISV.RCV.DTO.OBARcvLineDTO,UFIDA.U9.ISV.PM.PMISV")]
        /// <summary>
        /// 收货行信息
        /// </summary>
        public List<RcvLine> RcvLines { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string Memo { get; set; }

        /// <summary>
        /// 收货原则可改
        /// </summary>
        public bool IsRcvByChangeable { get; set; }

        /// <summary>
        /// 立账条件可改
        /// </summary>
        public bool IsConfirmTermChangeable { get; set; }

        /// <summary>
        /// 付款条件可改
        /// </summary>
        public bool IsPaymentTermChangeable { get; set; }

        /// <summary>
        /// 价表可改
        /// </summary>
        public bool IsPriceListChangeable { get; set; }

        /// <summary>
        /// 税率
        /// </summary>
        public decimal TaxRate { get; set; }

        [DzSimpleObject("UFIDA.U9.PM.DTOs.BESimp4UIDTO,UFIDA.U9.PM.PMBE")]
        /// <summary>
        /// 交易币
        /// </summary>
        public string TC { get; set; }

        /// <summary>
        /// 整单费用 
        /// </summary>
        public decimal HeadFeeTC { get; set; } = 0;

        /// <summary>
        /// 整单费用
        /// </summary>
        public decimal HeadFeeFC { get; set; } = 0;

        [DzEnum(" UFIDA.U9.CBO.SCM.Enums.RejectModeEnum, UFIDA.U9.CBO.SCMBE")]
        /// <summary>
        /// 拒收处理
        /// </summary>
        public int RejectMode { get; set; } = -1;

        [DzEnum("UFIDA.U9.CBO.SCM.Enums.ReceivementTypeEnum,UFIDA.U9.CBO.SCMBE")]
        /// <summary>
        /// 收货单类型
        /// 采购退货单           1
        /// 采购收货单           0
        /// 销售退回收货单       2
        /// </summary>
        public int ReceivementType { get; set; } = 0;

        [DzSimpleObject("UFIDA.U9.PM.DTOs.BESimp4UIDTO,UFIDA.U9.PM.PMBE")]
        /// <summary>
        /// 采购组织
        /// </summary>
        public string PurOrg { get; set; }

        [DzSimpleObject("UFIDA.U9.PM.DTOs.BESimp4UIDTO,UFIDA.U9.PM.PMBE")]
        /// <summary>
        /// 结算组织
        /// </summary>
        public string BalanceOrg { get; set; }

        /// <summary>
        /// 是否关系企业
        /// </summary>
        public bool IsRelationCompany { get; set; } = false;

        [DzSimpleObject("UFIDA.U9.PM.DTOs.BESimp4UIDTO,UFIDA.U9.PM.PMBE")]
        /// <summary>
        /// 出货单组织
        /// </summary>
        public string ShipOrg { get; set; }

        [DzEnum("UFIDA.U9.PM.Enums.RtnTypeEnum,UFIDA.U9.PM.PMBE")]
        /// <summary>
        /// 源RCV退货类型
        /// </summary>
        public int RtnType { get; set; } = 0;

        /// <summary>
        /// 组织编码
        /// </summary>
        public string OrgCode { get; set; }

        [DzSimpleObject("UFIDA.U9.PM.DTOs.BESimp4UIDTO,UFIDA.U9.PM.PMBE")]
        /// <summary>
        /// 预付政策
        /// </summary>
        public string PrepayPolicy { get; set; }

	
        [DzList("UFIDA.U9.ISV.RCV.DTO.OBARcvFeeDTO,UFIDA.U9.ISV.PM.PMISV")]
        public List<RcvFee> RcvFees { get; set; } = new List<RcvFee>();

        [DzList("UFIDA.U9.ISV.RCV.DTO.OBARcvDiscountDTO,UFIDA.U9.ISV.PM.PMISV")]
        public List<RcvDiscount> RcvDiscount { get; set; } = new List<RcvDiscount>();

        [DzList("UFIDA.U9.ISV.RCV.DTO.OBARcvTaxDTO,UFIDA.U9.ISV.PM.PMISV")]
        public List<RcvTax> RcvTax { get; set; } = new List<RcvTax>();

        [DzList("UFIDA.U9.ISV.RCV.DTO.OBARcvAddressDTO,UFIDA.U9.ISV.PM.PMISV")]
        public List<RcvAddress> RcvAddress { get; set; } = new List<RcvAddress>();

        [DzList("UFIDA.U9.ISV.RCV.DTO.OBARcvContactDTO,UFIDA.U9.ISV.PM.PMISV")]
        public List<RcvContact> RcvContacts { get; set; } = new List<RcvContact>();

        

        /// <summary>
        /// 是否行审 
        /// </summary>
        public bool IsLineApprove { get; set; } = false;
    }
}
